<template>
  <div>
    <div class="mint-swipe">
      <mt-swipe :auto="4000">
        <mt-swipe-item v-for="banner in bannerList" :key="banner.id"><a :href="banner.link"><img :src="banner.image"
                                                                                                 alt=""></a>
        </mt-swipe-item>
      </mt-swipe>
    </div>
    <h3>
      HomeContainer
    </h3>
  </div>
</template>
<script>
  import {Toast} from "mint-ui"

  export default {
    name: "HomeContainer",
    data() {
      return {
        bannerList: []
      };
    },
    created() {
      this.getBanner();
    },
    methods: {
      getBanner() {
        this.$http.get(this.$dev.HOST + "/banner/").then(response => {
          this.bannerList = response.data;
        }).catch(error => {
          console.log(error.response)
        });
      }
    }
  }
</script>

<style scoped>
  .mint-swipe {
    height: 200px;
  }

  .mint-swipe-item a img {
    width: 100%;
    height: 100%;
  }
</style>
